package palmtop.com.palmtop.adapter;

import android.content.Context;
import android.content.Intent;
import android.text.method.ScrollingMovementMethod;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.Button;

import com.beardedhen.androidbootstrap.AwesomeTextView;

import net.grandcentrix.tray.AppPreferences;

import java.util.ArrayList;

import palmtop.com.palmtop.R;
import palmtop.com.palmtop.activity.CluedetailActivity;
import palmtop.com.palmtop.model.Clue;
import palmtop.com.palmtop.model.ClueWx;
import palmtop.com.palmtop.util.BadgeView;

/**
 * Created by Administrator on 2017/9/1.
 */

public class WxClueResAdapter extends BaseAdapter {
    private ArrayList<ClueWx> arrlist;
    private Context context;
//    String role_id;

    public WxClueResAdapter(ArrayList<ClueWx> arrlist, Context context) {
        this.arrlist = arrlist;
        this.context = context;
    }

    @Override
    public int getCount() {
        return arrlist.size();
    }

    @Override
    public Object getItem(int i) {
        return arrlist.get(i);
    }

    @Override
    public long getItemId(int i) {
        return i;
    }

    @Override
    public View getView(int pos, View view, ViewGroup viewGroup) {
        view = LayoutInflater.from(context).inflate(R.layout.item_cluewxres,null);
        AwesomeTextView reportname = view.findViewById(R.id.reportname);
        AwesomeTextView rescontent = view.findViewById(R.id.rescontent);
        rescontent.setMovementMethod(ScrollingMovementMethod.getInstance());
        ClueWx clueWx = arrlist.get(pos);
        reportname.setText(clueWx.getReportname()+":");
        rescontent.setText(clueWx.getRescontent());
        return view;
    }
}
